package com.big.tree.dao;

import com.big.tree.aspect.RoutingWith;
import com.big.tree.entity.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

/**
 * @author cm601
 */
@Repository
public interface UserDao {

    @RoutingWith("salve")
    @Insert("insert into t_user(name,age) values(#{name},#{age})")
    int saveUser(User user);

    @RoutingWith("master")
    @Select("select * from t_user where id = #{id}")
    User getById(@Param("id") Long id);
}
